﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Purchase.ReadAPI.APPlicant.Command;
using ErrorCode;
using Purchase.Domain;
using Purchase.ReadAPI.DTOs.采购管理;


namespace Purchase.ReadAPI.Controllers
{
    /// <summary>
    /// 采购模块
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class MassageController : ControllerBase
    {
        private readonly IMediator mediator;

        public MassageController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<List<BillOfMaterialDto>>> GetBillOfMaterial([FromQuery] GetBillOfMaterialCommand request )
        {
            return await mediator.Send(request);
        }

    }
}
